package org.simtube.util;

import java.util.Comparator;

public class CosineComparator implements Comparator<DocItem> {

	private DocVector query;
	
	public CosineComparator(DocVector query) {
		this.query = query;
	}
	
	@Override
	public int compare(DocItem v1, DocItem v2) {
		return Double.compare(v1.vector.multiply(query), v2.vector.multiply(query));
	}
}
